/*
 * @lc app=leetcode.cn id=136 lang=javascript
 *
 * [136] 只出现一次的数字
 */

// @lc code=start
/**
 * @param {number[]} nums
 * @return {number}
 */
var singleNumber = function(nums) {
    let eleArr = []
    for (let index = 0; index < nums.length; index++) {
        const element = nums[index];
        let position = eleArr.indexOf(element)
        if (position !== -1) {
            eleArr.splice(position, 1)
        } else {
            eleArr.push(element)
        }
    }
    return eleArr[0]
};
// @lc code=end

